<?php		
#########################################
#	HIDE COPYRIGHT UNTIL FURTHER NOTICE #			
#########################################			
#		//check for a pending copyright-review
#		$copyright = new Copyright($item->getItemID());
#		$copyright_alert = '';
#		if(($copyright->getStatus() != 'APPROVED') && ($copyright->getStatus() != 'DENIED')) {
#			$copyright_alert = '<span class="alert">! pending review !</span>';
#		}
#########################################
?>
<?php if ($this->msg) { ?><div id="alertMsg" align="center" class="failedText"><?php print($this->msg); ?></div><?php } ?>
<br/>        
<?php
if($this->editReserve){ ?>
<div style="text-align:right; font-weight:bold;"><a href="index.php?cmd=editClass&amp;ci=<?php print($this->reserve->getCourseInstanceID()); ?>">Return to Class</a></div>
<?php 
	if (Account_Rd::atLeastStaff()) { 
	?>
<div style="text-align:right; font-weight:bold;"><a href="index.php?cmd=displayRequest&amp;requestId=<?php print($this->reserve->getRequest()->getId()); ?>#r<?php print($this->reserve->getRequest()->getId()); ?>">Return to the Processing Queue</a></div>
<?php }

} else if ('' != $this->searchParams) { 
?>
<div style="text-align:right; font-weight:bold;"><a href="index.php?cmd=doSearch<?php print($this->searchParams); ?>">Return to Search Results</a></div>
<?php
} 
 ?>
<div class="contentTabs">
	<ul>
		<li <?php print($this->tabStyles['meta']); ?>><a href="index.php?cmd=editItem&amp;<?php print($this->editItemHref); ?><?php print($this->searchParams); ?>">Item Info</a></li>
<?php
if(Account_Rd::atLeastStaff()){ ?>
		<li <?php print($this->tabStyles['history']); ?>><a href="index.php?cmd=editItem&amp;<?php print($this->editItemHref); ?>&amp;tab=history<?php print($this->searchParams); ?>">History</a></li>
		<li <?php print($this->tabStyles['status']); ?>><a href="index.php?cmd=editItem&amp;<?php print($this->editItemHref); ?>&amp;tab=status<?php print($this->searchParams); ?>">Status</a></li>
		<li <?php print($this->tabStyles['physicalCopies']); ?>><a href="index.php?cmd=editItem&amp;<?php print($this->editItemHref); ?>&amp;tab=physicalCopies<?php print($this->searchParams); ?>">Physical Copies</a></li>
<?php
#########################################
#	HIDE COPYRIGHT UNTIL FURTHER NOTICE #
#	(remove spaces b/n <, >, and ?)		#
#########################################

#				<li < ?=$tab_styles['copyright']? >><a href="index.php?cmd=editItem&amp;< ?=$edit_item_href? >&amp;tab=copyright">Copyright < ?=$copyright_alert? ></a></li>
#########################################

} ?>
	</ul>
</div>
<div class="clear"></div>	
<?php	
switch($this->tab) {
	case 'history':
		$this->forward('displayItemHistory');
		break;
	case 'status':
		$this->forward('displayItemStatus');
		break;
	case 'physicalCopies':
		$this->forward('displayItemPhysicalCopies'); 
		break;			
	default:
		if ($this->reserve instanceof reserve) {
			$status = $this->reserve->getStatusId();
			if (
				$status != Rd_Request_Status::getDeniedStatusId()
				|| Account_Rd::atLeastStaff()
			){
				$this->forward('displayEditItemMeta'); //($item, $reserve, $dub_array);
				?></div><?php  //#TODO track down the stray div...
			} else {
?>
<p> Access to this reserve has be denied.  Please contact your reserves desk for assistance. </p>
<?php 
			}
		} else if ($this->item instanceof reserveItem ) {
			$status = $this->item->getStatus();
			if (
				($status != Rd_Item::DENIED_STATUS
				&& $status == Rd_Item::SHADOWED_STATUS)
				|| Account_Rd::atLeastStaff()
			){
				$this->forward('displayEditItemMeta'); //($item, $reserve, $dub_array);
			} else {
?>
<p>Access to this item has be denied.  Please contact your reserves desk for assistance. </p>
<?php 
			}
		} else {
			$status = 'UNKNOWN'; //#TODO we shouldn't end up in this case...
			if (
				Account_Rd::atLeastStaff()
			){
				$this->forward('displayEditItemMeta'); //($item, $reserve, $dub_array);
			} else {
?>
<p>'Access to this item has be denied.  Please contact your reserves desk for assistance. </p>
<?php 
			}
		}
}
